<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>提现列表</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('pay/cash/index')}">
        时间:
        <input type="text" class="form-control js-bootstrap-datetime" name="start_time"
               value="{$start_time|default=''}"
               style="width: 140px;" autocomplete="off">-
        <input type="text" class="form-control js-bootstrap-datetime" name="end_time"
               value="{$end_time|default=''}"
               style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
        账号:
        <input type="text" class="form-control" name="user_login" style="width: 200px;"
               value="{$user_login|default=''}" placeholder="请输入关键字..."> &nbsp; &nbsp;
        提现状态:
        <select class="form-control" name="status" style="width: 140px;">
            <option<if $status==''> selected </if> value=''>全部</option>
            <option<if $status=='0'> selected </if> value='0'>等待提现</option>
            <option<if $status=='1'> selected </if> value='1'>提现成功</option>
            <option<if $status=='-1'> selected </if> value='-1'>提现失败</option>
        </select> &nbsp;&nbsp;
        提现方式:
        <select class="form-control" name="type" style="width: 140px;">
            <option<if $status==''> selected </if> value=''>全部</option>
            <option<if $status=='1'> selected </if> value='1'>用户提现</option>
            <option<if $status=='2'> selected </if> value='2'>后台下分</option>
        </select> &nbsp;&nbsp;
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('pay/cash/index')}">清空</a>
    </form>
    <php>
        $status = [0 => '等待提现', 1 => '提现成功', -1 => '提现失败'];
        $status_color = [0 => '#F39C12', 1 => 'green', -1 => 'red'];
        $type = [1 => '银行卡', 2 => '后台操作'];
    </php>
    <form class="js-ajax-form" action="" method="post">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="50">ID</th>
                <th>账号</th>
                <th>金额</th>
                <th>提现信息</th>
                <th>提现状态</th>
                <th>提现方式</th>
                <th>描述信息</th>
                <th>修改时间</th>
                <th>创建时间</th>
                <th width="15%">操作</th>
            </tr>
            </thead>
            <foreach name="list" item="vo">
                <tr>
                    <td><b>{$vo.id}</b></td>
                    <td>{$vo.user_login}</td>
                    <td>{$vo.amount}</td>
                    <td>{$vo.card_user_name}/{$vo.bank_name}<br>{$vo.bank_no}</td>
                    <td><span style="color: {$status_color[$vo.status]}">{$status[$vo['status']]}</span></td>
                    <td>{$type[$vo['type']]}</td>
                    <td>{$vo['remark']?$vo['remark']:''}</td>
                    <td>{$vo['update_time']}</td>
                    <td>{$vo['create_time']}</td>
                    <td>
                        <if condition="$vo['status'] == 0">
                            <a class="btn btn-xs btn-success" href="javascript:;" onclick='methodAction("{:url('pay/cash/publish',array('id'=>$vo['id']))}","提现")'>提现</a>
                        </if>
                        <if condition="$vo['status'] == 0">
                            <a class="btn btn-xs btn-warning" href="javascript:;" onclick='methodAction("{:url('pay/cash/refuse',array('id'=>$vo['id']))}","拒绝")'>拒绝</a>
                        </if>
                        <a class="btn btn-xs btn-danger js-ajax-delete"
                           href="{:url('pay/cash/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
        </table>
        <ul class="pagination">{$page|default=''}</ul>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/layer/layer.js"></script>
<script>

    function methodAction(url, title, options) {
        var index = layer.open({
            type: 2,
            title: title,
            area: ['700px', '450px'],
            fixed: false, //不固定
            maxmin: true,
            content: url,
            // end: function () {
            //     reloadPage(window);
            // }
        });
    }

    function methodActions(url, title, options) {
        var index = layer.open({
            type: 2,
            title: title,
            area: ['500px', '300px'],
            fixed: false, //不固定
            maxmin: true,
            content: url,
            // end: function () {
            //     reloadPage(window);
            // }
        });
    }

    function reloadPage(win) {
        win.location.reload();
    }

    $(function () {
        setCookie("refersh_time", 0);
        Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
            //批量复制
            $('.js-articles-copy').click(function (e) {
                var ids = [];
                $("input[name='ids[]']").each(function () {
                    if ($(this).is(':checked')) {
                        ids.push($(this).val());
                    }
                });

                if (ids.length == 0) {
                    art.dialog.through({
                        id: 'error',
                        icon: 'error',
                        content: '您没有勾选信息，无法进行操作！',
                        cancelVal: '关闭',
                        cancel: true
                    });
                    return false;
                }

                ids = ids.join(',');
                art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=copy&ids=" + ids, {
                    title: "批量复制",
                    width: "300px"
                });
            });
            //批量移动
            $('.js-articles-move').click(function (e) {
                var ids = [];
                $("input[name='ids[]']").each(function () {
                    if ($(this).is(':checked')) {
                        ids.push($(this).val());
                    }
                });

                if (ids.length == 0) {
                    art.dialog.through({
                        id: 'error',
                        icon: 'error',
                        content: '您没有勾选信息，无法进行操作！',
                        cancelVal: '关闭',
                        cancel: true
                    });
                    return false;
                }

                ids = ids.join(',');
                art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=move&old_term_id={$term.term_id|default=0}&ids=" + ids, {
                    title: "批量移动",
                    width: "300px"
                });
            });
        });
    });

</script>
</body>
</html>